from django.urls import path
from django.contrib.auth.decorators import login_required
from . import views

app_name = 'ai_text'

urlpatterns = [

    # API 接口路由 - 统一使用api/前缀
    path('text/generate/', login_required(views.generate_text), name='generate_text_api'),
    path('text/records/', login_required(views.text_list), name='text_list_api'),
    path('text/records/<int:record_id>/', login_required(views.get_record_detail), name='record_detail_api'),
    path('text<record_id>/favorite/', login_required(views.toggle_favorite), name='toggle_favorite_api'),
    path('text<record_id>/delete/', login_required(views.delete_record), name='delete_record_api'),
    
    # 新增API接口
    path('text/content-types/', login_required(views.get_content_types), name='get_content_types_api'),
    path('text/prompt-template/', login_required(views.get_prompt_template), name='get_prompt_template_api'),
]